package com.app.jpa.webcontent.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.app.entity.MenuOption;
import com.app.jpa.webcontent.WebContentService;

@Service("jpaWebContentService")
@Repository
@Transactional
public class WebContenServiceImpl implements WebContentService {

	@PersistenceContext
	private EntityManager em;

	@Transactional(readOnly = true)
	@Override
	public List<MenuOption> getListMenuOption() {
		List<MenuOption> options = em.createNamedQuery(
				"MenuOption.getListMenuOption", MenuOption.class)
				.getResultList();
		return options;
	}

}
